﻿/**************************************************
 * Quantum Quest Game Project                     *
 *                                                *
 * Version:                                       *
 * Design 1.0                                     *
 *                                                *
 * Authors:                                       *
 * Michael Fowler                                 *
 * Michael Timmins                                *
 * Octavian Geagla                                *
 * Eric Cooper                                    *
 *                                                *
 * License:                                       *
 * Unknown                                        *
 *                                                *
 * ************************************************/

/**************************************************
 * QQIBody.cs                                     *
 *                                                *
 * Created:                                       *
 * 6/15/09, Octavian Geagla                       *
 *                                                *
 * Updated:                                       *
 * 6/16/09                                        *
 *                                                *
 * Description:                                   *
 * Interfce for 'Body' which will interact        *
 * with physics.                                  *
 *                                                *
 * ************************************************/

using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.Linq;

namespace QuantumQuest
{
    public partial class QQBody : UserControl
    {
        protected QQVector2 _position;
        protected QQVector2 _velocity;
        protected QQVector2 _acceleration;
        protected double _mass;
        protected bool _isStationary;
        protected bool _isConstantAccel;
        protected QQVector2 _heading;

        public QQBody(QQVector2 position, QQVector2 velocity, QQVector2 accleration, double mass, bool isStationary, bool isConstantAccel)
        {

            InitializeComponent();
            _position = position;
            _velocity = velocity;
            _acceleration = accleration;
            _heading.X = _velocity.X;
            _heading.Y = _velocity.Y;
            _heading.Normalize();

            _mass = mass;
            _isStationary = isStationary;
            _isConstantAccel = isConstantAccel;
            
        }
        public QQBody()
        {

        }

        public QQVector2 Position
        {
            get
            {
                return _position;
            }
            set
            {
                
                    _position = value;
                
            }
        }
        public QQVector2 Velocity
        {
            get
            {
                return _velocity;
            }
            set
            {
                
                    _velocity = value;
               
            }
        }
        public QQVector2 Acceleration
        {
            get
            {
                return _acceleration;
            }
            set
            {
              
                    _acceleration = value;
               
            }
        }
        public double Mass
        {
            get
            {
                return _mass;
            }
            set
            {
               
                    _mass = value;
                
            }
        }
        public QQVector2 Heading
        {
            get
            {
                return _heading;
            }
            set
            {
                
                    _heading = value;
                    _heading.Normalize();
               
            }
        }
        public bool IsStationary
        {
            get
            {
                return _isStationary;
            }
            set
            {
                _isStationary = value;
            }
        }
        public bool IsConstantAccel
        {
            get
            {
                return _isConstantAccel;
            }
            set
            {
                _isConstantAccel = value;
            }
        }
        public void RotateCounterClockWRad(double drad)
        {
            _heading.ThetaRad += drad;
        }
        public void RotateCounterClockWDeg(double ddeg)
        {
            _heading.ThetaDeg += ddeg;
        }
        public void RotateClockWRad(double drad)
        {
            RotateCounterClockWRad(((2.0) * (Math.PI)) - drad);
        }
        public void RotateClockWDeg(double ddeg)
        {
            RotateCounterClockWDeg(360 - ddeg);
        }

    }
}
